package org.linlinjava.litemall.db.dao;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.ILiquormallLiquor;

import java.util.List;


public interface ILiquormallLiquorMapper {

    /**
     * 真删除
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 新增数据
     * @param iLiquormallLiquor
     * @return
     */
    int insert(ILiquormallLiquor iLiquormallLiquor);

    /**
     * 根据id查数据
     * @param id
     * @return
     */
    ILiquormallLiquor selectByPrimaryKey(Integer id);

    /**
     * 逻辑删除
     * @param id
     * @return
     */
    int logicalDeleteByPrimaryKey(Integer id);

    int addCountNumberOf(@Param("id") int id, @Param("countNumberOf") int countNumberOf );

    ILiquormallLiquor selectLastOne();

    int update(ILiquormallLiquor iLiquormallLiquor);

    List<ILiquormallLiquor> queryAllLiquor();
    List<ILiquormallLiquor> queryAllLiquorPage(Integer page, Integer limit);
    List<ILiquormallLiquor> queryAllLiquorLimitFive();
    List<ILiquormallLiquor> queryAllLiquorMy(Integer userId);
    List<ILiquormallLiquor> queryAllLiquorBySit(ILiquormallLiquor iLiquormallLiquor);
    List<ILiquormallLiquor> queryAllLiquorByAgeAsc(ILiquormallLiquor iLiquormallLiquor);
    List<ILiquormallLiquor> queryAllLiquorByAgeDesc(ILiquormallLiquor iLiquormallLiquor);
    List<ILiquormallLiquor> queryAllLiquorByPriceAsc(ILiquormallLiquor iLiquormallLiquor);
    List<ILiquormallLiquor> queryAllLiquorByPriceDesc(ILiquormallLiquor iLiquormallLiquor);

    /**
     * 统计酒友圈数量
     *
     * @return
     */
    long count();

    /**
     * 根据标题查询酒友圈
     *
     * @param title
     * @return
     */
    List<ILiquormallLiquor> queryAllLiquorByTitle(@Param("title") String title);
}